package com.mobisystems.youpark.utils;

import com.parse.ParseGeoPoint;

import android.location.Location;
import android.widget.EditText;

public class UtilityFunctions {

	// helper functions for registration
	public boolean isEmpty(EditText editText) {
		if (editText.getText().toString().trim().length() > 0) {
			return false;
		} else {
			return true;
		}
	}

	// Helper method for string checks
	public boolean isMatching(EditText editTextOne, EditText editTextTwo) {
		String editText1 = editTextOne.getText().toString();
		String editText2 = editTextTwo.getText().toString();
		if (editText1.equals(editText2)) {
			return true;
		} else {
			return false;
		}
	}
	
	
	// Convert a google maps location into a ParseGeoPoint object.
	public ParseGeoPoint getGeoPointFromLocation(Location location) {
		return new ParseGeoPoint(location.getLatitude(), location.getLongitude());
	}
	
	public static double convertDollarsToCents(String dollarAmount) {
		double dollarInCents = Double.parseDouble(dollarAmount);
		return dollarInCents;
	}
}
